<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="form1" onsubmit="return false">
        <input type="text" name="a" id="a">
        <input type="submit" value="form1">
    </form>

    <form action="form2" onsubmit="returnFalse()">
        <input type="text" name="a" id="a">
        <input type="submit" value="form2-invalid">
    </form>

    <form action="form3" onsubmit="return returnFalse()">
        <input type="text" name="a" id="a">
        <input type="submit" value="form3">
    </form>

    <form action="form4" onsubmit="prevent(event)">
        <input type="text" name="a" id="a">
        <input type="submit" value="form4">
    </form>

    <form action="form5" onclick="return false">
        <input type="text" name="a" id="a">
        <input type="submit" value="form5">
    </form>

    <script>
        function returnFalse(event) {
            return false;
        }

        function prevent(event) {
            event.preventDefault()
            return true;
        }

    </script>
</body>

</html>